﻿@model IEnumerable<BusinessLayer.cs.Employee>

@{
    ViewBag.Title = "Index";
}
<div style="font-family: Arial">
    <h2>Employee List</h2>

    <p>
        @Html.ActionLink("Create New", "Create")
    </p>
    <table border="1">
        <tr>
            <th>
                @Html.DisplayNameFor(model => model.Name)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Gender)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.City)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.DateOfBirth)
            </th>
            <th>
                Action
            </th>
        </tr>

        @foreach (var item in Model)
        {
            using (@Html.BeginForm("Delete", "Employee2", new { id = item.EmployeeId }))
            {
                <tr>
                    <td>
                        @Html.DisplayFor(modelItem => item.Name)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.Gender)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.City)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.DateOfBirth)
                    </td>
                    <td>
                        @Html.ActionLink("Edit", "Edit", new { id = item.EmployeeId }) |
                        @*@Html.ActionLink("Details", "Details", new {id = item.EmployeeId}) |
                            @Html.ActionLink("Delete", "Delete", new {id = item.EmployeeId})*@

                        <input type="submit" value="Delete" onclick="return confirm('Would you like to delete this client with the id = @item.Name')" />

                    </td>
                </tr>
            }
        }

    </table>
</div>
